﻿@{ 
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="renderer" content="webkit|ie-comp|ie-stand" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link href="~/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/css/style.css" />
    <link href="~/assets/css/codemirror.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/assets/css/ace.min.css" />
    <link rel="stylesheet" href="~/font/css/font-awesome.min.css" />
    <link href="~/layui/css/layui.css" rel="stylesheet" />
    <link href="~/css/LayuiCheckbox.css" rel="stylesheet" />
    <!--[if lte IE 8]>
      <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
    <![endif]-->
    <script src="~/js/jquery-1.9.1.min.js"></script>
    <script src="~/assets/js/bootstrap.min.js"></script>
    <script src="~/assets/js/typeahead-bs2.min.js"></script>
    <script src="~/assets/js/jquery.dataTables.min.js"></script>
    <script src="~/assets/js/jquery.dataTables.bootstrap.js"></script>
    <script src="~/assets/layer/layer.js" type="text/javascript"></script>
    <script src="~/js/H-ui.js" type="text/javascript"></script>
    <script src="~/js/displayPart.js" type="text/javascript"></script>
    <script src="~/assets/laydate/laydate.js" type="text/javascript"></script>
    <script src="~/layui/layui.js"></script>
    <title>系统日志</title>
</head>

<body>
    <div class="margin clearfix">
        <div id="system_style">
            <div class="search_style">

                <ul class="search_content clearfix">
                    <li><label class="l_f">名称</label><input name="" type="text" class="text_add" style=" width:250px"></li>
                    <li><label class="l_f">时间</label><input class="inline laydate-icon" id="start" style=" margin-left:10px;"></li>
                    <li style="width:90px;"><button type="button" class="btn_search"><i class="fa fa-search"></i>查询</button></li>
                </ul>
            </div>
            <!--系统日志-->
            <div class="system_logs">
                <table id="demo" lay-filter="test"></table>

            </div>
        </div>
    </div>
</body>
</html>
<script>
    function Format(datetime, fmt) {
        var newtime = datetime.replace(/\/Date\((\d+)\)\//gi, "$1");
        if (parseInt(newtime) == newtime) {
            if (newtime.length == 10) {
                newtime = parseInt(newtime) * 1000;
            } else if (newtime.length == 13) {
                newtime = parseInt(newtime);
            }
        }
        newtime = new Date(newtime);
        var o = {
            "M+": newtime.getMonth() + 1,                 //月份
            "d+": newtime.getDate(),                    //日
            "h+": newtime.getHours(),                   //小时
            "m+": newtime.getMinutes(),                 //分
            "s+": newtime.getSeconds(),                 //秒
            "q+": Math.floor((newtime.getMonth() + 3) / 3), //季度
            "S": newtime.getMilliseconds()             //毫秒
        };
        if (/(y+)/.test(fmt))
            fmt = fmt.replace(RegExp.$1, (newtime.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt))
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }

  laydate({
    elem: '#start',
    event: 'focus'
});
$(function() {
  var oTable1 = $('#sample-table').dataTable( {
  "aaSorting":false,//默认第几个排序
  "bStateSave": true,//状态保存
  "aoColumnDefs": [
	//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	{"orderable":false,"aTargets":[0,1,2,3]}// 制定列不参与排序
      ]
  });

      layui.use('table', function(){
      var table = layui.table;

      //第一个实例
      table.render({
        elem: '#demo'
        ,height: 312
          , url: '/System/QueryLogsAll' //数据接口
          , page: true
          , cols: [[ //表头
          {type:'checkbox' ,fixed: 'left'}
          ,{field: 'AdminUserId', title: '编号', width:150, sort: true}
          ,{field: 'JName', title: '用户名', width:150, sort: true, }
          , { field: 'Name', title: '角色名称', width: 150 }
          ,{field: 'Content', title: '内容', width:300}
          , { field: 'CreateTime', title: '创建日期', sort: true, templet: '<div>{{ Format(d.CreateTime,"yyyy-MM-dd hh:mm:ss")}}</div>' }
          
          ]]
        ,page: true //开启分页
      });
    });
})
</script>
